{% extends 'base/cms_base.html' %}

{% block title %}
    发布文章
{% endblock %}

{% block head %}
    <script src="{% static 'ueditor/ueditor.config.js' %}"></script>
    <script src="{% static 'ueditor/ueditor.all.min.js' %}"></script>
    <script src="{% static 'js/write_article.min.js' %}"></script>
{% endblock %}

{% block content-header %}
    <h3>发布文章</h3>
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <form action="" class="form" method="post">
                    <div class="box-body">
                        <div class="form-group">
                            <label for="title-form">标题</label>
                            <input type="text" class="form-control" name="title" id="title-form">
                        </div>
                        <div class="form-group">
                            <label for="category-form">分类</label>
                            <select class="form-control" name="category" id="category-form">
                                {% for category in categories %}
                                    <option value="{{ category.pk }}">{{ category.name }}</option>
                                {% endfor %}
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="desc-form">描述</label>
                            <input type="text" class="form-control" name="desc" id="desc-form">
                        </div>
                        <div class="form-group">
                            <label for="thumbnail-form">缩略图</label>
                            <div class="input-group">
                                <input type="text" class="form-control" name="thumbnail" id="thumbnail-form">
                                <span class="input-group-btn">
                                    <label class="btn btn-default btn-file">
                                        上传图片<input hidden type="file" class="btn btn-default" id="thumbnail-btn">
                                    </label>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="content-form">内容</label>
                            <script id="ueditor" type="text/plain" style="width: 100%">
                            </script>
                        </div>
                    </div>
                    <div class="box-footer">
                        <button id="submit-btn" class="btn btn-primary pull-right">发布文章</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}